package File;

import java.io.*;

public class Demo15 {
    public static void main(String[] args) throws FileNotFoundException {
        File file = new File("test1.txt");
        try(OutputStream outputStream = new FileOutputStream(file)) {
            byte[] data = new byte[128];
            data[0] = 'h';
            data[1] = 'e';
            data[2] = 'l';
            data[3] = 'l';
            data[4] = 'o';
            outputStream.write(data, 0, 5);
            outputStream.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
